{extend name="base" /}
{block name="body"}
<link rel="stylesheet" href="/static/layuiadmin/style/template.css" media="all">
<div class="layui-fluid layadmin-homepage-fluid">
    <div class="layui-row layui-col-space8">
        <div class="layui-col-md3">
            <div class="layadmin-homepage-panel layadmin-homepage-shadow">
                <div class="layui-card text-center">
                    <div class="layui-card-body">
                        <div class="layadmin-homepage-pad-ver">
                            <img class="layadmin-homepage-pad-img" src="/static/img/no_image_100x100.jpg" width="96" height="96">
                        </div>
                        <h4 class="layadmin-homepage-font">{$customer.cname}</h4>
                        <p class="layadmin-homepage-min-font">{:user_config_toval('intention',$customer['intention'],'customer')}</p>

                        <button class="layui-btn layui-btn-fluid"><i class="layui-icon layui-icon-cellphone"></i>{$customer.mobile}</button>
                    </div>
                </div>
                <p class="layadmin-homepage-about">
                    客户标签
                </p>
                <ul class="layadmin-homepage-list-inline">
                    <a href="javascript:;" class="layui-btn">来源：{:user_config_toval('come_from',$customer['come_from'],'customer')}</a>
                    
                    <a href="javascript:;" class="layui-btn layui-btn-normal">类型：{:user_config_toval('type',$customer['type'],'customer')}</a>
                    
                    <a href="javascript:;" class="layui-btn layui-btn-danger">状态：{:user_config_toval('status',$customer['status'],'customer')}</a>
                </ul>
                {foreach name="config_customer" item="r"}
                <p class="layadmin-homepage-about">
                    {$r.title}
                </p>
                <ul class="layadmin-homepage-list-inline">
                    {if $r.type eq 'input'}
                    <a href="javascript:;" class="layui-btn">{if isset($customer.jdata[$r.name])}{$customer.jdata[$r.name]}{/if}</a>
                    {/if}
                    {if $r.type eq 'textarea'}
                    {if isset($customer.jdata[$r.name])}{$customer.jdata[$r.name]}{/if}
                    {/if}
                    {if $r.type eq 'select'}
                    <a href="javascript:;" class="layui-btn">{if isset($customer.jdata[$r.name])}{:user_config_toval($r.name,$customer.jdata[$r.name],'customer')}{/if}</a>
                    {/if}
                    {if $r.type eq 'radio'}
                    <a href="javascript:;" class="layui-btn">{if isset($customer.jdata[$r.name])}{:user_config_toval($r.name,$customer.jdata[$r.name],'customer')}{/if}</a>
                    {/if}
                    {if $r.type eq 'image'}
                    {if isset($customer.jdata[$r.name])}<img src="{$customer.jdata[$r.name]}">{/if}
                    {/if}
                     
                </ul>
                {/foreach}
                <p class="layadmin-homepage-about">
                    地址
                </p>
                <ul class="layadmin-homepage-list-group">
                    <li class="list-group-item"><i class="layui-icon layui-icon-location"></i>{$customer.province}{$customer.city}{$customer.area} {$customer.address}</li>
                </ul>
                <p class="layadmin-homepage-about">
                    备注信息
                </p>
                <div class="layadmin-homepage-pad-hor">
                    <mdall>{$customer.remark}</mdall><br><br>
                </div>
                
            </div>
        </div>
        <div class="layui-col-md9">
            <div class="layui-fluid layadmin-homepage-content">
                <div class="layui-row layui-col-space20 layadmin-homepage-list-imgtxt">
                    <div class="layui-col-md7">
                        <div class="grid-demo">
                            {foreach name="track" item="r"}
                            <?php $user = \app\common\model\User::get($r['uid']);?>
                            <div class="panel-body layadmin-homepage-shadow">
                                <a href="javascript:;" class="media-left">
                                    <img src="/static/img/no_image_100x100.jpg" height="46px" width="46px">
                                </a>
                                <div class="media-body">
                                    <div class="pad-btm">
                                        <p class="fontColor"><a href="javascript:;">{if $user['realname']}{$user.realname}{else}{$user.username}{/if}</a>  <span>{$r.create_time}</span> 添加了新的<span> {:user_config_toval('type',$r['type'],'track')}</span></p>
                                    </div>
                                    <p>{$r.remark}</p>
                                    <p>
                                        {foreach name="config_track" item="v"}
                                        {$v.title}:
                                            {if $v.type eq 'input'}
                                            <a href="javascript:;" class="layui-btn layui-btn-xs">{if isset($r.jdata[$v.name])}{$r.jdata[$v.name]}{/if}</a>
                                            {/if}
                                            {if $v.type eq 'textarea'}
                                            {if isset($r.jdata[$v.name])}{$r.jdata[$v.name]}{/if}
                                            {/if}
                                            {if $v.type eq 'select'}
                                            <a href="javascript:;" class="layui-btn layui-btn-xs">{if isset($r.jdata[$v.name])}{:user_config_toval($v.name,$r.jdata[$v.name],'track')}{/if}</a>
                                            {/if}
                                            {if $v.type eq 'radio'}
                                            <a href="javascript:;" class="layui-btn layui-btn-xs">{if isset($r.jdata[$v.name])}{:user_config_toval($v.name,$r.jdata[$v.name],'track')}{/if}</a>
                                            {/if}
                                            {if $v.type eq 'image'}
                                            {if isset($r.jdata[$v.name])}<img src="{$r.jdata[$v.name]}" >{/if}
                                            {/if}
                                        {/foreach}</p>
                                    <div class="media">
                                        <div class="media-right">
                                            <ul class="list-inline">
                                                <li>
                                                    <a href="{:url('user/customer/edit_track', ['id' => $r.id])}" class="layui-btn layui-btn-xs">修改</a>
                                                </li>
                                                <li>
                                                    <a href="{:url('user/customer/del_track', ['id' => $r.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            {/foreach}
                            <div class="page">{$track->render()}</div>
                        </div>
                    </div>
                    <div class="layui-col-md5">
                        <div class="grid-demo">
                            <div class="layui-card homepage-top">
                                <div class="layui-card-header">
                                    <br>
                                    <h3 class="panel-title">
                                        <a href="{:url('user/customer/edit', ['id' => $id])}" class="layui-btn">修改客户</a>
                                        <a href="{:url('user/customer/add_remind', ['id' => $id])}" class="layui-btn layui-btn-danger">设置提醒</a>
                                        <a href="{:url('user/customer/add_track', ['id' => $id])}" class="layui-btn layui-btn-normal">新增跟踪</a>
                                        <a href="{:url('user/order/add', ['cid' => $id])}" class="layui-btn layui-btn-warm">新增交易</a>
                                    </h3>
                                </div>
                            </div>
                            <div class="layui-card">
                                <div class="layui-card-header">提醒日志</div>
                                <div class="layui-card-body">
                                    <ul class="layui-timeline">
                                        {foreach name="remind" item="r"}
                                        <li class="layui-timeline-item">
                                            <i class="layui-icon layui-timeline-axis"></i>
                                            <div class="layui-timeline-content layui-text">
                                              <div class="layui-timeline-title">
                                                <?php echo date('Y-m-d',$r['remind_time'])?> &nbsp;&nbsp;&nbsp;{$r.remark} &nbsp;&nbsp;
                                                {if isset($r.jdata.web) and $r.jdata.web =='on'}<i class="fa fa-comment" aria-hidden="true" title="后台提醒"></i> {/if}
                                                {if isset($r.jdata.wechat) and $r.jdata.wechat =='on'}<i class="fa fa-weixin" aria-hidden="true" title="微信提醒"></i> {/if}
                                                {if isset($r.jdata.sms) and $r.jdata.sms =='on'}<i class="fa fa-envelope-open" aria-hidden="true" title="短信提醒"></i> {/if}
                                              </div>
                                            </div>
                                        </li>
                                        {/foreach}
                                    </ul>
                                </div>
                            </div>

                            <div class="layui-card homepage-bottom">
                                <div class="layui-card-header">
                                    <h3 class="panel-title">
                                        <i class="layui-icon layui-icon-dollar"></i>
                                        交易情况
                                    </h3>
                                </div>
                                <div class="layui-card-body">
                                    {foreach name="order" item="o"}
                                    <a href="javascript:;" class="layadmin-privateletterlist-item">
                                      <div class="meida-left">
                                        ￥ {$o.total} 元
                                      </div>
                                      <div class="meida-right">
                                        <p>{$o.create_time}</p>
                                        <mdall>{$o.remark}</mdall>
                                      </div>
                                    </a>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}